From e0fabe8e81000c924d211e4731d0626357630c69 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 28 Feb 2014 17:13:47 +0100 Subject: [PATCH] xsm: streamline xsm_default_action() The privileges being strongly ordered is better reflected by using fall through within the respective switch statement. Signed-off-by: Jan Beulich Acked-by: Daniel De Graaf --- xen/include/xsm/dummy.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index a84218d58a..3bcd9414c1 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -59,20 +59,14 @@ static always_inline int xsm_default_action( switch ( action ) { case XSM_HOOK: return 0; - case XSM_DM_PRIV: - if ( src->is_privileged ) - return 0; - if ( target && src->target == target ) - return 0; - return -EPERM; case XSM_TARGET: if ( src == target ) return 0; - if ( src->is_privileged ) - return 0; + /* fall through */ + case XSM_DM_PRIV: if ( target && src->target == target ) return 0; - return -EPERM; + /* fall through */ case XSM_PRIV: if ( src->is_privileged ) return 0; -- 2.30.2